using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Decisions.HL7.Message;
using DecisionsFramework;

namespace Decisions.HL7.Message
{
    public class SupplementalServiceInformationValuesAttribute:RuleAttribute
    {
        private Dictionary<HL7Version, string[]> validVersionCodes = new Dictionary<HL7Version, string[]>();
        private Dictionary<HL7Version, string[]> validVersionDescriptions = new Dictionary<HL7Version, string[]>();
        private Dictionary<HL7Version, HL7TableType> tableVersionTypes = new Dictionary<HL7Version, HL7TableType>();

        public SupplementalServiceInformationValuesAttribute()
        {
            // init the values for table version types
						tableVersionTypes[HL7Version.v24] = HL7TableType.User;
						tableVersionTypes[HL7Version.v25] = HL7TableType.User;
						tableVersionTypes[HL7Version.v251] = HL7TableType.User;
						tableVersionTypes[HL7Version.v26] = HL7TableType.User;
						tableVersionTypes[HL7Version.v27] = HL7TableType.User;
			
            
			// init the values for version codes
						validVersionCodes[HL7Version.v24] = new string[]{"1ST","2ND","3RD","4TH","5TH","ANT","A/P","BLT","DEC","DST","LAT","LFT","LLQ","LOW","LUQ","MED","OR","PED","POS","PRT","PRX","REC","RLQ","RGH","RUQ","UPP","UPR","WCT","WOC","WSD"};
						validVersionCodes[HL7Version.v25] = new string[]{""};
						validVersionCodes[HL7Version.v251] = new string[]{"..."};
						validVersionCodes[HL7Version.v26] = new string[]{"..."};
						validVersionCodes[HL7Version.v27] = new string[]{"…"};
			
			// init the values for version descriptions
						validVersionDescriptions[HL7Version.v24] = new string[]{"First","Second","Third","Fourth","Fifth","Anterior","Anterior/Posterior","Bilateral","Decubitus","Distal","Lateral","Left","Left Lower Quadrant","Lower","Left Upper Quadrant","Medial","Operating Room","Pediatric","Posterior","Portable","Proximal","Recumbent","Right Lower Quadrant","Right","Right Upper Quadrant","Upper","Upright","With Contrast","Without Contrast","With Sedation"};
						validVersionDescriptions[HL7Version.v25] = new string[]{""};
						validVersionDescriptions[HL7Version.v251] = new string[]{"No suggested values<p>Individual implementations may use vocabularies such as the SNOMED DICOM Micro-glossary (SDM) or private (local) entries."};
						validVersionDescriptions[HL7Version.v26] = new string[]{"No suggested values<p>Individual implementations may use vocabularies such as the SNOMED DICOM Micro-glossary (SDM) or private (local) entries."};
						validVersionDescriptions[HL7Version.v27] = new string[]{"No suggested values<p>Individual implementations may use vocabularies such as the SNOMED DICOM Micro-glossary (SDM) or private (local) entries."};
			            

        }

        
        public override ValidationIssue[] RunRule(string name, object owningObject, object value)
        {
            //todo: check if the value is valid in the current version
            //if the value is not valid in the current version, add it as a validation issue


            return new ValidationIssue[0];
        }
    }
}
